package cn.xyy.security;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.xyy.common.domain.mvc.R;

/**
 * 处理 404
 * 
 * @author xyy
 */
@RestController
public class NotFoundHandle implements ErrorController {

	@RequestMapping("/error")
	public R error(HttpServletRequest request, HttpServletResponse response) throws IOException {
		response.setStatus(200);
		return R.error(404, "not found");
	}

	@Override
	public String getErrorPath() {
		// TODO Auto-generated method stub
		return null;
	}

}
